import { Context } from "egg";

export default () => {
  return async (ctx: Context, next) => {
    try {
      await next();
    } catch (e: any) {
      ctx.body = { code: 502, msg: e?.message };
    }
  };
};
